startNestedScroll

open fun startNestedScroll(@NonNull view: View, axes: Int): Boolean(source)

Begin a nestable scroll operation along the given axes.

This version of the method just calls startNestedScroll using the touch input type.

Return

true if a cooperative parent was found and nested scrolling has been enabled for the current gesture.

Parameters

view

view for which to start the scroll.

axes

Flags consisting of a combination of SCROLL_AXIS_HORIZONTAL and/or SCROLL_AXIS_VERTICAL.


open fun startNestedScroll(@NonNull view: View, axes: Int, type: Int): Boolean(source)

Begin a nestable scroll operation along the given axes.

A view starting a nested scroll promises to abide by the following contract:

The view will call startNestedScroll upon initiating a scroll operation. In the case of a touch scroll this corresponds to the initial ACTION_DOWN. In the case of touch scrolling the nested scroll will be terminated automatically in the same manner as requestDisallowInterceptTouchEvent. In the event of programmatic scrolling the caller must explicitly call stopNestedScroll to indicate the end of the nested scroll.

If startNestedScroll returns true, a cooperative parent was found. If it returns false the caller may ignore the rest of this contract until the next scroll. Calling startNestedScroll while a nested scroll is already in progress will return true.

At each incremental step of the scroll the caller should invoke dispatchNestedPreScroll once it has calculated the requested scrolling delta. If it returns true the nested scrolling parent at least partially consumed the scroll and the caller should adjust the amount it scrolls by.

After applying the remainder of the scroll delta the caller should invoke dispatchNestedScroll, passing both the delta consumed and the delta unconsumed. A nested scrolling parent may treat these values differently. See onNestedScroll.

Return

true if a cooperative parent was found and nested scrolling has been enabled for the current gesture.

Parameters

view

view on which to start the scroll.

axes

Flags consisting of a combination of SCROLL_AXIS_HORIZONTAL and/or SCROLL_AXIS_VERTICAL.

type

the type of input which cause this scroll event

See also